<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>window窗口对象</title>
</head>
<body>
<h1>prompt提示对话框</h1>
<input type="test" id="message" size="40" value="请在此输入信息">
<input type="button" value="显示对话框" onclick="pro()"/>
<script>
function pro() {
    let message=document.getElementById(`message`);
    message.value=window.prompt(message.value,`返回的信息`);
}
</script>

<h1>打开子窗口</h1>
<a href="javascript:;" onclick="window.open(`http://www.z01.com`,`new`)">打开新窗口</a> <br>
<a href="javascript:;" onclick="window.open(`http://www.z01.com`,`new`,`width=300,height=300`)">打开300*300大小的新窗口</a> <br>
<a href="javascript:;" onclick="window.open(`http://www.z01.com`,`new`,`width=300,height=300`,`top=0,left=200`)">打开右上角300*300大小的新窗口</a> <br>
<a href="javascript:;" onclick="window.open(`http://www.z01.com`,`new`,`width=300,height=300`,`scrollbars,resizable`)">打开带滚动条的固定窗口</a> <br>

<h1>控制弹出窗口居屏幕显示器中显示，使用moveTo方法</h1>
<map name="map">
    <area shape="rect" coords="82,17,125,39" href="#" alt="" onclick="manage()">
    <area shape="circle" coords="49,28,14" href="" alt="">
    <a href="javascript:;" onclick="manage()">弹出居中</a>
</map>
<script>
function manage() {
    let hdc=window.open(`http://www.z01.com`,`new`,`width=300,height=300`);
    width=screen.width;
    height=screen.height;
    hdc.moveTo((width-300)/2,(height-300)/2);
}
</script>



</body>
</html>